#pragma once

#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QGroupBox>

class RenderWidget;

class MatrixDecompositionWindow : public QWidget {
    Q_OBJECT
public:
    explicit MatrixDecompositionWindow(QWidget *parent = nullptr);
    ~MatrixDecompositionWindow() override = default;
private slots:
    void onLUPressed();
    void onQRPressed();
    void onEigenPressed();

private:
    RenderWidget *render_; // 复用 RenderWidget，可视化分解结果
    QGroupBox    *ctrlGrp_;
    QLineEdit    *le11_, *le12_, *le21_, *le22_;    //输入 2×2 矩阵的四个元素
    QPushButton  *btnLU_, *btnQR_, *btnEigen_;      // “分解”按钮

    void setupUi();
};
